#include "UGDefaultEventHandler.h"

namespace ugame {
    UGDefaultEventHandler::UGDefaultEventHandler() {
    }
    
    UGDefaultEventHandler::~UGDefaultEventHandler() {
    }
    //create handler luon luon chay voi tat ca cac event
    UGDefaultEventHandler* UGDefaultEventHandler::create(int order, Ref* handlerObj, UGHandlerFunc handlerFunc) {
        UGDefaultEventHandler* handler = new UGDefaultEventHandler();
        
        handler->order = order;
        handler->handlerObj = handlerObj;
        handler->handlerFunc = handlerFunc;
        
        return handler;
    }
    //create handler chay voi 1 eventID cu the
    UGDefaultEventHandler* UGDefaultEventHandler::createByEventId(int eventId, int order, Ref* handlerObj, UGHandlerFunc handlerFunc) {
        UGDefaultEventHandler* handler = new UGDefaultEventHandler();
        
        handler->eventId = eventId;
        handler->order = order;
        handler->handlerObj = handlerObj;
        handler->handlerFunc = handlerFunc;
        
        return handler;
    }
    //create handler chay voi 1 eventType cu the
    UGDefaultEventHandler* UGDefaultEventHandler::createByEventType(int eventType, int order, Ref* handlerObj, UGHandlerFunc handlerFunc) {
        UGDefaultEventHandler* handler = new UGDefaultEventHandler();
        
        handler->eventType = eventType;
        handler->order = order;
        handler->handlerObj = handlerObj;
        handler->handlerFunc = handlerFunc;
        
        return handler;
    }
}